
.text
.global _start

#define MPIDR_ID_BITS        0xff00ffffff

#define DOORBELL_ADDR        0x407ffa0
#define BL1_RUN_ADDR         0x4000000
#define BL1_MAGIC_VALUE      0x12345678

_start:
    mrs x4, mpidr_el1
    ldr x5, =MPIDR_ID_BITS
    tst x4,x5
    b.ne secondary_core_boot

main_core_boot:
    ldr w4, =DOORBELL_ADDR
    ldr w4, [x4]
    ldr w0, =BL1_MAGIC_VALUE
    cmp w4, w0
    bne main_core_boot

    ldr x0, =BL1_RUN_ADDR
    br x0

secondary_core_boot:
    wfe
    b secondary_core_boot
